!function (t) {
    function i(s) {
        if (e[s]) return e[s].exports;
        var n = e[s] = {
            exports: {},
            id: s,
            loaded: !1
        };
        return t[s].call(n.exports, n, n.exports, i), n.loaded = !0, n.exports
    }
    var e = {};
    return i.m = t, i.c = e, i.p = "./", i(0)
}([function (t, i, e) {
    e(1), e(2), e(3), e(4), e(5), e(6), e(7)
}, function (t, i) {
    Vue.component("member_unit", {
        template:'' +
        '<div class="active tab-pane">' +
            '<div class="box box-danger">' +
                '<div class="box-header">' +
                    '<h3 class="box-title"></h3>' +
                    '<div class="box-tools">' +
                        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
                            // '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
                            // '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
                        '</div>' +
                    '</div>' +
                '</div>' +
                '<div class="box-body table-responsive no-padding">' +
                    '<table class="table table-striped table-hover">' +
                        '<thead><tr><th style="width:35px;">#</th><th>会员单位</th><th>团队人数</th><th v-if="setting[0]==1">保证金</th><th>资金余额</th><th>团队余额</th><th>团队盈亏</th><th>团队充值</th><th>团队提现</th><th>状态</th><th style="width:230px;">操作</th></tr></thead>' +
                        '<tbody><tr v-for="(index, item) in list">' +
                            '<td>{{index+1}}</td>' +
                            '<td>{{item.real_name}}<span style="font-size:11px;color:grey;">[{{item.mobile_phone}}]</span></td>' +
                            '<td>{{item.team_num}}</td>' +
                            '<td v-if="setting[0]==1">' +
                                '<span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1, item.id, 2)">加</span>' +
                                '<span class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2, item.id, 2)">扣</span>{{item.deposit}}</td>' +
                            '<td><template v-if="setting[1]==1">' +
                                '<span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1, item.id, 1)">加</span>' +
                                '<span class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2, item.id, 1)">扣</span></template>{{item.balance | currency ""}}</td>' +
                            '<td>{{item.team_balance | currency ""}}</td>' +
                            '<td>{{item.team_gain | currency ""}}</td>' +
                            '<td>{{item.recharge | currency ""}}</td>' +
                            '<td>{{item.draw | currency ""}}</td>' +
                            '<td><span v-if="item.state==0" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(item.id, 1);">正常</span>' +
                            '<span v-if="item.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(item.id, 0);">停用</span></td>' +
                            '<td><span class="label bg-purple" style="cursor:pointer;margin-right:3px;" @click="openUserCommissionSetWin(item);" v-if="setting[2]==1">返佣</span>' +
                            '<span class="label btn-success" style="cursor:pointer;margin-right:3px;" @click="openEditUserWin(item.id);">修改</span>' +
                            '<span class="label label-primary" style="cursor:pointer;margin-right:3px;" @click="gotoInfoPage(item.id);">详情</span>' +
                            '<span class="label btn-danger" style="cursor:pointer;margin-right:3px;" @click="edit_data({{item.id}});">重置密码</span></tr>' +
                        '</tbody>' +
                    '</table>' +
                '</div>' +
                '<div class="box-footer clearfix">' +
                    '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
                    '<div class="col-sm-7">' +
                        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
                            '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
                            '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
                            '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
                        '</ul>' +
                    '</div>' +
                '</div>' +
                '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
            '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id : 0,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                list : null,
                setting : null,
                type : 1,
                navigatepageNums : null
            }
        },
        events: {
            'refreshUserList':function (t) {
                for (var i = 0; i < this.list.length; i++) {
                    if (this.list[i].id == t.id) {
                        this.list[i][t.key] = t.value;
                    }
                }
            }
        },
        ready: function() {
            this.getData();
        },
        methods: {
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/user/tolist", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    isStatistics:0,
                    level:1,
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.setting = i.data.setting;
                    t.type = i.data.type;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            changeState : function(id, state) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/changeState", {id:id, state:state}, function(i) {
                    if (i == 1) {
                        for (var i=0; i<t.list.length; i++) {
                            if (t.list[i].id == id) {
                                t.list[i].state = state;
                            }
                        }
                        if (state == 1) {
                            $.scojs_message('账号已停用', $.scojs_message.TYPE_ERROR);
                        } else if (state == 0) {
                            $.scojs_message('账号已启用', $.scojs_message.TYPE_OK);
                        }
                    }
                    close_layuiLayerLoad();
                });
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
            openEditUserWin : function (id) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/getUserInfo", {id:id}, function(i) {
                    close_layuiLayerLoad();
                    var title = '修改会员单位';
                    t.$dispatch('openUserWin', {title:title, level_name:'会员单位', user:i});
                });
            },
            capitalAdjusted : function (type, id, adjustedType) {
                this.$dispatch('capitalAdjusted', {id:id, adjustedType:adjustedType, type:type, balance:0});
            },
            openUserCommissionSetWin : function (user) {
                this.$dispatch('openUserCommissionSetWin', {title:'设置返佣', user:user});
            },
        }
    })
}, function (t, i) {
    Vue.component("micro_cycle", {
        template:'' +
        '<div class="active tab-pane">' +
        '<div class="box box-danger">' +
        '<div class="box-header">' +
        '<h3 class="box-title"></h3>' +
        '<div class="box-tools">' +
        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
        // '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
        // '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '<div class="box-body table-responsive no-padding">' +
        '<table class="table table-striped table-hover">' +
        '<thead><tr><th style="width:35px;">#</th><th>微圈管理员</th><th>所属会员单位</th><th>团队人数</th><th v-if="setting[0]==1">保证金</th><th>资金余额</th><th>团队余额</th><th>团队盈亏</th><th>团队充值</th><th>团队提现</th><th>状态</th><th style="width:230px;">操作</th></tr></thead>' +
        '<tbody><tr v-for="(index, item) in list">' +
        '<td>{{index+1}}</td>' +
        '<td>{{item.real_name}}<span style="font-size:11px;color:grey;">[{{item.mobile_phone}}]</span></td>' +
        '<td>{{item.p_1name}}</td>' +
        '<td>{{item.team_num}}</td>' +
        '<td v-if="setting[0]==1">{{item.deposit}}</td>' +
        '<td><template v-if="setting[1]==1">' +
        '<span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1, item.id, 1)">加</span>' +
        '<span class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2, item.id, 1)">扣</span></template>{{item.balance | currency ""}}</td>' +
        '<td>{{item.team_balance | currency ""}}</td>' +
        '<td>{{item.team_gain | currency ""}}</td>' +
        '<td>{{item.recharge | currency ""}}</td>' +
        '<td>{{item.draw | currency ""}}</td>' +
        '<td><span v-if="item.state==0" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(item.id, 1);">正常</span>' +
        '<span v-if="item.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(item.id, 0);">停用</span></td>' +
        '<td><span class="label bg-purple" style="cursor:pointer;margin-right:3px;" @click="openUserCommissionSetWin(item);" v-if="setting[2]==1">返佣</span>' +
        '<span class="label btn-success" style="cursor:pointer;margin-right:3px;" @click="openEditUserWin(item.id);">修改</span>' +
        '<span class="label label-primary" style="cursor:pointer;margin-right:3px;" @click="gotoInfoPage(item.id);">详情</span>' +
        '<span class="label btn-danger" style="cursor:pointer;margin-right:3px;" @click="edit_data({{item.id}});">重置密码</span></tr>' +
        '</tbody>' +
        '</table>' +
        '</div>' +
        '<div class="box-footer clearfix">' +
        '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
        '<div class="col-sm-7">' +
        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
        '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
        '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
        '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
        '</ul>' +
        '</div>' +
        '</div>' +
        '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
        '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id : 0,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                setting : null,
                list : null,
                navigatepageNums : null
            }
        },
        events: {
            'refreshUserList':function (t) {
                for (var i = 0; i < this.list.length; i++) {
                    if (this.list[i].id == t.id) {
                        this.list[i][t.key] = t.value;
                    }
                }
            }
        },
        ready: function() {
            this.getData();
        },
        methods: {
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/user/tolist", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    isStatistics:0,
                    level:2
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.setting = i.data.setting;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            changeState : function(id, state) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/changeState", {id:id, state:state}, function(i) {
                    if (i == 1) {
                        for (var i=0; i<t.list.length; i++) {
                            if (t.list[i].id == id) {
                                t.list[i].state = state;
                            }
                        }
                        if (state == 1) {
                            $.scojs_message('账号已停用', $.scojs_message.TYPE_ERROR);
                        } else if (state == 0) {
                            $.scojs_message('账号已启用', $.scojs_message.TYPE_OK);
                        }
                    }
                    close_layuiLayerLoad();
                });
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
            openEditUserWin : function (id) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/getUserInfo", {id:id}, function(i) {
                    close_layuiLayerLoad();
                    var title = '修改微圈管理员';
                    t.$dispatch('openUserWin', {title:title, level_name:'微圈管理员', user:i});
                });

            },
            capitalAdjusted : function (type, id, adjustedType) {
                this.$dispatch('capitalAdjusted', {id:id, adjustedType:adjustedType, type:type, balance:0});
            },
            openUserCommissionSetWin : function (user) {
                this.$dispatch('openUserCommissionSetWin', {title:'设置返佣', user:user});
            },
        }
    })
}, function (t, i) {
    Vue.component("middleman", {
        template:'' +
        '<div class="active tab-pane">' +
        '<div class="box box-danger">' +
        '<div class="box-header">' +
        '<h3 class="box-title"></h3>' +
        '<div class="box-tools">' +
        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
        // '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
        // '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '<div class="box-body table-responsive no-padding">' +
        '<table class="table table-striped table-hover">' +
        '<thead><tr><th style="width:35px;">#</th><th>经纪人</th><th>所属会员单位</th><th>所属微圈</th><th>团队人数</th><th v-if="setting[0]==1">保证金</th><th>资金余额</th><th>团队余额</th><th>团队盈亏</th><th>团队充值</th><th>团队提现</th><th>状态</th><th style="width:230px;">操作</th></tr></thead>' +
        '<tbody><tr v-for="(index, item) in list">' +
        '<td>{{index+1}}</td>' +
        '<td>{{item.real_name}}<span style="font-size:11px;color:grey;">[{{item.mobile_phone}}]</span></td>' +
        '<td>{{item.p_1name}}</td>' +
        '<td>{{item.p_2name}}</td>' +
        '<td>{{item.team_num}}</td>' +
        '<td v-if="setting[0]==1">{{item.deposit}}</td>' +
        '<td><template v-if="setting[1]==1">' +
        '<span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1, item.id, 1)">加</span>' +
        '<span class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2, item.id, 1)">扣</span></template>{{item.balance | currency ""}}</td>' +
        '<td>{{item.team_balance | currency ""}}</td>' +
        '<td>{{item.team_gain | currency ""}}</td>' +
        '<td>{{item.recharge | currency ""}}</td>' +
        '<td>{{item.draw | currency ""}}</td>' +
        '<td><span v-if="item.state==0" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(item.id, 1);">正常</span>' +
        '<span v-if="item.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(item.id, 0);">停用</span></td>' +
        '<td><span class="label bg-purple" style="cursor:pointer;margin-right:3px;" @click="openUserCommissionSetWin(item);" v-if="setting[2]==1">返佣</span>' +
        '<span class="label btn-success" style="cursor:pointer;margin-right:3px;" @click="openEditUserWin(item.id);">修改</span>' +
        '<span class="label label-primary" style="cursor:pointer;margin-right:3px;" @click="gotoInfoPage(item.id);">详情</span>' +
        '<span class="label btn-danger" style="cursor:pointer;margin-right:3px;" @click="edit_data({{item.id}});">重置密码</span></tr>' +
        '</tbody>' +
        '</table>' +
        '</div>' +
        '<div class="box-footer clearfix">' +
        '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
        '<div class="col-sm-7">' +
        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
        '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
        '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
        '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
        '</ul>' +
        '</div>' +
        '</div>' +
        '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
        '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id : 0,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                setting : null,
                list : null,
                navigatepageNums : null
            }
        },
        events: {
            'refreshUserList':function (t) {
                for (var i = 0; i < this.list.length; i++) {
                    if (this.list[i].id == t.id) {
                        this.list[i][t.key] = t.value;
                    }
                }
            }
        },
        ready: function() {
            this.getData();
        },
        methods: {
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/user/tolist", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    isStatistics:0,
                    level:3
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.setting = i.data.setting;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            changeState : function(id, state) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/changeState", {id:id, state:state}, function(i) {
                    if (i == 1) {
                        for (var i=0; i<t.list.length; i++) {
                            if (t.list[i].id == id) {
                                t.list[i].state = state;
                            }
                        }
                        if (state == 1) {
                            $.scojs_message('账号已停用', $.scojs_message.TYPE_ERROR);
                        } else if (state == 0) {
                            $.scojs_message('账号已启用', $.scojs_message.TYPE_OK);
                        }
                    }
                    close_layuiLayerLoad();
                });
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
            openEditUserWin : function (id) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/getUserInfo", {id:id}, function(i) {
                    close_layuiLayerLoad();
                    var title = '修改经纪人';
                    t.$dispatch('openUserWin', {title:title, level_name:'经纪人', user:i});
                });

            },
            capitalAdjusted : function (type, id, adjustedType) {
                this.$dispatch('capitalAdjusted', {id:id, adjustedType:adjustedType, type:type, balance:0});
            },
            openUserCommissionSetWin : function (user) {
                this.$dispatch('openUserCommissionSetWin', {title:'设置返佣', user:user});
            },
        }
    })
}, function (t, i) {
    Vue.component("customer", {
        template:'' +
        '<div class="active tab-pane">' +
        '<div class="box box-danger">' +
        '<div class="box-header">' +
        '<h3 class="box-title"></h3>' +
        '<div class="box-tools">' +
        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
        // '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
        // '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '<div class="box-body table-responsive no-padding">' +
        '<table class="table table-striped table-hover">' +
        '<thead><tr><th style="width:35px;">#</th><th>客户昵称</th><th>手机号码</th><th>所属会员单位</th><th>所属微圈</th><th>所属经纪人</th><th v-if="setting[0]==1">保证金</th><th>资金余额</th><th>盈亏</th><th>充值</th><th>提现</th><th>状态</th><th style="width:230px;">操作</th></tr></thead>' +
        '<tbody><tr v-for="(index, item) in list">' +
        '<td>{{index+1}}</td>' +
        '<td>{{item.nick_name}}</td>' +
        '<td>{{item.mobile_phone}}</td>' +
        '<td>{{item.p_1name}}</td>' +
        '<td>{{item.p_2name}}</td>' +
        '<td>{{item.p_3name}}</td>' +
        '<td v-if="setting[0]==1">{{item.deposit}}</td>' +
        '<td><template v-if="setting[1]==1">' +
        '<span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1, item.id, 1)">加</span>' +
        '<span class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2, item.id, 1)">扣</span></template>{{item.balance | currency ""}}</td>' +
        '<td>{{item.team_gain | currency ""}}</td>' +
        '<td>{{item.recharge | currency ""}}</td>' +
        '<td>{{item.draw | currency ""}}</td>' +
        '<td><span v-if="item.state==0" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(item.id, 1);">正常</span>' +
        '<span v-if="item.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(item.id, 0);">停用</span></td>' +
        '<td><span class="label bg-purple" style="cursor:pointer;margin-right:3px;" @click="openUserCommissionSetWin(item);" v-if="setting[2]==1">返佣</span>' +
        '<span class="label btn-success" style="cursor:pointer;margin-right:3px;" @click="openEditUserWin(item.id);">修改</span>' +
        '<span class="label label-primary" style="cursor:pointer;margin-right:3px;" @click="gotoInfoPage(item.id);">详情</span>' +
        '<span class="label btn-danger" style="cursor:pointer;margin-right:3px;" @click="edit_data({{item.id}});">重置密码</span></tr>' +
        '</tbody>' +
        '</table>' +
        '</div>' +
        '<div class="box-footer clearfix">' +
        '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
        '<div class="col-sm-7">' +
        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
        '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
        '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
        '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
        '</ul>' +
        '</div>' +
        '</div>' +
        '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
        '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id : 0,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                setting : null,
                list : null,
                navigatepageNums : null
            }
        },
        events: {
            'refreshUserList':function (t) {
                for (var i = 0; i < this.list.length; i++) {
                    if (this.list[i].id == t.id) {
                        this.list[i][t.key] = t.value;
                    }
                }
            }
        },
        ready: function() {
            this.getData();
        },
        methods: {
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/user/tolist", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    isStatistics:0,
                    level:4
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.setting = i.data.setting;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            changeState : function(id, state) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/changeState", {id:id, state:state}, function(i) {
                    if (i == 1) {
                        for (var i=0; i<t.list.length; i++) {
                            if (t.list[i].id == id) {
                                t.list[i].state = state;
                            }
                        }
                        if (state == 1) {
                            $.scojs_message('账号已停用', $.scojs_message.TYPE_ERROR);
                        } else if (state == 0) {
                            $.scojs_message('账号已启用', $.scojs_message.TYPE_OK);
                        }
                    }
                    close_layuiLayerLoad();
                });
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
            openEditUserWin : function (id) {
                var t = this;
                layuiLayerLoad();
                postMsg(root+"/user/getUserInfo", {id:id}, function(i) {
                    close_layuiLayerLoad();
                    var title = '修改客户';
                    t.$dispatch('openUserWin', {title:title, level_name:'客户', user:i});
                });
            },
            capitalAdjusted : function (type, id, adjustedType) {
                this.$dispatch('capitalAdjusted', {id:id, adjustedType:adjustedType, type:type, balance:0});
            },
            openUserCommissionSetWin : function (user) {
                this.$dispatch('openUserCommissionSetWin', {title:'设置返佣', user:user});
            },
        }
    })
},  function (t, i) {
    Vue.component("order", {
        template:'' +
        '<div class="active tab-pane">' +
            '<div class="box box-danger">' +
                '<div class="box-header">' +
                    '<h3 class="box-title"></h3>' +
                    '<div class="box-tools">' +
                        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
                            '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
                            '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
                        '</div>' +
                    '</div>' +
                '</div>' +
                '<div class="box-body table-responsive no-padding">' +
                    '<table class="table table-striped table-hover">' +
                    '<thead><tr><th style="width:35px;">#</th><th>订单编号</th><th>商品名称/规格</th><th>涨/跌</th><th>手数</th><th>操盘类型</th><th>占用</th><th>盈亏</th><th>手续费</th><th>日期</th></tr></thead>' +
                    '<tbody><tr v-for="(index, item) in list">' +
                        '<td>{{index+1}}</td>' +
                        '<td>{{item.out_trade_no}}</td>' +
                        '<td>{{item.play_name}} / <span style="font-size:11px;color:grey;">{{item.norms}}</span></td>' +
                        '<td><span class="badge bg-red" v-if="item.type == 1">买涨</span><span class="badge bg-green" v-if="item.type == 2">买跌</span></td><td>{{item.mun}}</td>' +
                        '<td><template v-if="item.pay_type == 3">建仓</template><template v-if="item.pay_type == 6">止盈平仓</template><template v-if="item.pay_type == 7">止损平仓</template><template v-if="item.pay_type == 7">结算平仓</template></td>' +
                        '<td>{{item.real_price}}</td><td>{{item.gain_price}}</td><td>{{item.fee_money}}</td>' +
                        '<td>{{item.datetime}}</td></tr>' +
                    '</tbody>' +
                    '</table>' +
                '</div>' +
                '<div class="box-footer clearfix">' +
                    '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
                    '<div class="col-sm-7">' +
                        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
                            '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
                            '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
                            '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
                        '</ul>' +
                    '</div>' +
                '</div>' +
                '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
            '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id:0,
                data_cycle:null,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                list : null,
                navigatepageNums : null
            }
        },
        events: {},
        ready: function() {
            this.initDateCycle(), this.getData();
        },
        methods: {
            initDateCycle: function () {
                var t = this;
                $('#date_cycle').daterangepicker({
                    type: 2,
                    // drops: 'up',
                    autoApply:false,
                    startDate: moment().subtract('month', 1),
                    endDate: moment(),
                    ranges : {
                        //'最近1小时': [moment().subtract('hours',1), moment()],
                        '今日': [moment().startOf('day'), moment()],
                        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('day', 1).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        '最近30日': [moment().subtract('days', 29), moment()]
                    },
                    opens : 'left', //日期选择框的弹出位置
                    separator : ' to ',
                    locale : {
                        separator:'/',
                        format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
                        applyLabel : '确定',
                        cancelLabel : '取消',
                        fromLabel : '起始时间',
                        toLabel : '结束时间',
                        customRangeLabel : '自定义',
                        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                        monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                        firstDay : 1
                    }
                }, function(start, end, label) {
                    //格式化日期显示框
                    // $('#data_cycle').val(start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD'));
                    t.data_cycle = start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD');
                    t.pageNum = 1;
                    t.getData();
                });
            },
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/tradeDetail/toOrderList", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    data_cycle:t.data_cycle
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
        }
    })
},  function (t, i) {
    Vue.component("ins", {
        template:'' +
        '<div class="active tab-pane">' +
        '<div class="box box-danger">' +
        '<div class="box-header">' +
        '<h3 class="box-title"></h3>' +
        '<div class="box-tools">' +
        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
        '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
        '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '<div class="box-body table-responsive no-padding">' +
        '<table class="table table-striped table-hover">' +
        '<thead><tr><th style="width:35px;">#</th><th>商户单号</th><th>类型</th><th>渠道</th><th>金额</th><th>手续费</th><th>余额</th><th>日期</th></tr></thead>' +
        '<tbody><tr v-for="(index, item) in list">' +
        '<td>{{index+1}}</td>' +
        '<td>{{item.out_trade_no}}</td>' +
        '<td>{{item.play_name}} / <span style="font-size:11px;color:grey;">{{item.norms}}</span></td>' +
        '<td><span class="badge bg-red" v-if="item.type == 1">买涨</span><span class="badge bg-green" v-if="item.type == 2">买跌</span></td><td>{{item.mun}}</td>' +
        '<td><template v-if="item.pay_type == 3">建仓</template><template v-if="item.pay_type == 5">止盈平仓</template><template v-if="item.pay_type == 6">止损平仓</template><template v-if="item.pay_type == 7">结算平仓</template></td>' +
        '<td>{{item.real_price}}</td><td>{{item.gain_price}}</td><td>{{item.fee_money}}</td>' +
        '<td>{{item.datetime}}</td></tr>' +
        '</tbody>' +
        '</table>' +
        '</div>' +
        '<div class="box-footer clearfix">' +
        '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
        '<div class="col-sm-7">' +
        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
        '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
        '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
        '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
        '</ul>' +
        '</div>' +
        '</div>' +
        '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
        '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id:0,
                data_cycle:null,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                list : null,
                navigatepageNums : null
            }
        },
        events: {},
        ready: function() {
            this.initDateCycle(), this.getData();
        },
        methods: {
            initDateCycle: function () {
                var t = this;
                $('#date_cycle').daterangepicker({
                    type: 2,
                    // drops: 'up',
                    autoApply:false,
                    startDate: moment().subtract('month', 1),
                    endDate: moment(),
                    ranges : {
                        //'最近1小时': [moment().subtract('hours',1), moment()],
                        '今日': [moment().startOf('day'), moment()],
                        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('day', 1).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        '最近30日': [moment().subtract('days', 29), moment()]
                    },
                    opens : 'left', //日期选择框的弹出位置
                    separator : ' to ',
                    locale : {
                        separator:'/',
                        format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
                        applyLabel : '确定',
                        cancelLabel : '取消',
                        fromLabel : '起始时间',
                        toLabel : '结束时间',
                        customRangeLabel : '自定义',
                        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                        monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                        firstDay : 1
                    }
                }, function(start, end, label) {
                    //格式化日期显示框
                    // $('#data_cycle').val(start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD'));
                    t.data_cycle = start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD');
                    t.pageNum = 1;
                    t.getData();
                });
            },
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/tradeDetail/toRechargeOrWithdrawals", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    data_cycle:t.data_cycle
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
        }
    })
},  function (t, i) {
    Vue.component("tradeDetail", {
        template:'' +
        '<div class="active tab-pane">' +
        '<div class="box box-danger">' +
        '<div class="box-header">' +
        '<h3 class="box-title"></h3>' +
        '<div class="box-tools">' +
        '<div class="input-group input-group-sm" style="width: 180px;float:left;">' +
        '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>' +
        '<input type="text" v-model="data_cycle" v-bind:value="data_cycle" id="date_cycle" class="form-control pull-right" readonly>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '<div class="box-body table-responsive no-padding">' +
        '<table class="table table-striped table-hover">' +
        '<thead><tr><th style="width:35px;">#</th><th>订单编号</th><th>商品名称/规格</th><th>涨/跌</th><th>手数</th><th>操盘类型</th><th>占用</th><th>盈亏</th><th>手续费</th><th>日期</th></tr></thead>' +
        '<tbody><tr v-for="(index, item) in list">' +
        '<td>{{index+1}}</td>' +
        '<td>{{item.out_trade_no}}</td>' +
        '<td>{{item.play_name}} / <span style="font-size:11px;color:grey;">{{item.norms}}</span></td>' +
        '<td><span class="badge bg-red" v-if="item.type == 1">买涨</span><span class="badge bg-green" v-if="item.type == 2">买跌</span></td><td>{{item.mun}}</td>' +
        '<td><template v-if="item.pay_type == 3">建仓</template><template v-if="item.pay_type == 5">止盈平仓</template><template v-if="item.pay_type == 6">止损平仓</template><template v-if="item.pay_type == 7">结算平仓</template></td>' +
        '<td>{{item.real_price}}</td><td>{{item.gain_price}}</td><td>{{item.fee_money}}</td>' +
        '<td>{{item.datetime}}</td></tr>' +
        '</tbody>' +
        '</table>' +
        '</div>' +
        '<div class="box-footer clearfix">' +
        '<div class="col-sm-5" style="top:5px;"> 当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条</div>' +
        '<div class="col-sm-7">' +
        '<ul id="paging" class="pagination pagination-sm no-margin pull-right">' +
        '<li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>' +
        '<li><a href="javascript:void(0);" v-bind:class="{\'page_active\':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>' +
        '<li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>' +
        '</ul>' +
        '</div>' +
        '</div>' +
        '<div class="overlay hidden"><i class="fa fa-refresh fa-spin"></i></div>' +
        '</div>' +
        '</div>',
        props: ['user_id'],
        data: function () {
            return {
                user_id:0,
                data_cycle:null,
                startRow : 0,
                endRow : 0,
                total : 0,
                firstPage : 0,
                lastPage : 0,
                pageNum : 1,
                pageSize : 10,
                list : null,
                navigatepageNums : null
            }
        },
        events: {},
        ready: function() {
            this.initDateCycle(), this.getData();
        },
        methods: {
            initDateCycle: function () {
                var t = this;
                $('#date_cycle').daterangepicker({
                    type: 2,
                    // drops: 'up',
                    autoApply:false,
                    startDate: moment().subtract('month', 1),
                    endDate: moment(),
                    ranges : {
                        //'最近1小时': [moment().subtract('hours',1), moment()],
                        '今日': [moment().startOf('day'), moment()],
                        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('day', 1).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        '最近30日': [moment().subtract('days', 29), moment()]
                    },
                    opens : 'left', //日期选择框的弹出位置
                    separator : ' to ',
                    locale : {
                        separator:'/',
                        format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
                        applyLabel : '确定',
                        cancelLabel : '取消',
                        fromLabel : '起始时间',
                        toLabel : '结束时间',
                        customRangeLabel : '自定义',
                        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                        monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                        firstDay : 1
                    }
                }, function(start, end, label) {
                    //格式化日期显示框
                    // $('#data_cycle').val(start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD'));
                    t.data_cycle = start.format('YYYY-MM-DD') + '/' + end.format('YYYY-MM-DD');
                    t.pageNum = 1;
                    t.getData();
                });
            },
            getData:function () {
                showLoad();
                var t = this;
                postMsg(root+"/tradeDetail/toOrderList", {
                    page_num : t.pageNum,
                    page_size : t.pageSize,
                    user_id:t.user_id,
                    data_cycle:t.data_cycle
                }, function(i) {
                    t.list = null;
                    t.list = i.data.list;
                    t.startRow = i.data.startRow;
                    t.endRow = i.data.endRow;
                    t.total = i.data.total;
                    t.firstPage = i.data.firstPage;
                    t.lastPage = i.data.lastPage;
                    t.navigatepageNums = i.data.navigatepageNums;
                    hideLoad();
                });
            },
            showPage : function(page) {
                this.pageNum = page;
                this.getData();
            },
            gotoInfoPage : function (id) {
                window.location.href = root + '#user/info/id/' + id;
            },
        }
    })
}]);